import type { AddressResult } from "@/types/address";
import type { UserAddress } from "@/types/order";
import { defineStore } from "pinia";
import { ref } from "vue";

export const useAddressStore = defineStore("address", () => {
  const selectedAddress = ref<AddressResult>()

  const chanageSelectedAddress = (val: AddressResult) => {
    selectedAddress.value = val
  }
  const clearSelectedAddress = () => {
    selectedAddress.value = undefined
  }
  return {
    selectedAddress,
    chanageSelectedAddress,
    clearSelectedAddress,
  }
})
